using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using MusicStoreMVC.Models.Mapping;

namespace MusicStoreMVC.Models
{
    public partial class DB_MUSIC_STOREContext : DbContext
    {
        static DB_MUSIC_STOREContext()
        {
            Database.SetInitializer<DB_MUSIC_STOREContext>(null);
        }

        public DB_MUSIC_STOREContext()
            : base("Name=DB_MUSIC_STOREContext")
        {
        }

        public DbSet<Album> Albums { get; set; }
        public DbSet<Artist> Artists { get; set; }
        public DbSet<Cart> Carts { get; set; }
        public DbSet<Genre> Genres { get; set; }
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderDetail> OrderDetails { get; set; }
        public DbSet<sysdiagram> sysdiagrams { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AlbumMap());
            modelBuilder.Configurations.Add(new ArtistMap());
            modelBuilder.Configurations.Add(new CartMap());
            modelBuilder.Configurations.Add(new GenreMap());
            modelBuilder.Configurations.Add(new OrderMap());
            modelBuilder.Configurations.Add(new OrderDetailMap());
            modelBuilder.Configurations.Add(new sysdiagramMap());
        }
    }
}
